package com.kuaiyan.sdkshell.ad;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.widget.LinearLayout;

import com.kuaiyan.sdkshell.R;
import com.wmcsk.KuaiyanSdk;
import com.wmcsk.defaultImp.DefaultGuangaoAdapter;

/**
 * Created by wm on 2017/12/18.
 */

public class TopTextActivity extends BaseActivity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_top_text);
        initTitleView();
        setTitleText("上文下图广告");
        LinearLayout topText = (LinearLayout) findViewById(R.id.topText);
        //上文下图 第一个参数为该广告位的唯一值，第二个为需要依附的viewGroup，第三个为广告位id，第四个为广告回调监听
        KuaiyanSdk.getInstance().requestAd("Index3Activity_left_pic", topText, "81", new DefaultGuangaoAdapter() {
            @Override
            public void onSuccess(Object type) {
                // TODO Auto-generated method stub
                Log.e("MainActivity_topText", "success");
            }

            @Override
            public void onNetWorkError() {
                // TODO Auto-generated method stub

            }

            @Override
            public void threadError(int code, String message, Exception e) {
                // TODO Auto-generated method stub
                Log.e("MainActivity_topText", code + "   " + message);
            }
        });
    }
}
